package com.fita.wechat.service;

import java.util.List;
import java.util.Map;

import com.fita.entity.agent.Agent;
import com.fita.entity.data.Supplier;
import com.fita.entity.dto.ehi.response.LocationDetailResponse;
import com.fita.entity.order.Order;
import com.fita.entity.order.OrderDetails;
import com.fita.entity.order.OrderSpecialEquipment;
import com.fita.entity.order.OrderStatus;
import com.fita.entity.order.OrderVehicleFee;
import com.fita.wechat.entity.Shopping;

/**
 * 
 * @author 宋剑宏
 *
 */
public interface OrderService extends DataService<Order>{

	/**
	 * 根据orderStatus查询订单
	 * 
	 * @param status
	 * @return
	 */
	public List<Order> list(OrderStatus status);

	/**
	 * 根据id查询订单详情
	 * 
	 * @param id
	 * @return
	 */
	public Order load(Long id);
	
	/**
	 * 
	 * @param orderId
	 * @param sign
	 * @param mobile
	 * @return
	 */
	public Order load(Long orderId, String sign, String mobile);
	
	/**
	 * 
	 * @param order
	 * @return
	 */
	public OrderDetails loadDetails(Order order);
	
	/**
	 * 
	 * @param supplierCode
	 * @return
	 */
	public Supplier loadSupplier(String supplierCode);

	/**
	 * 根据id取消预定
	 * 
	 * @param id
	 */
	public void update(Long id);

	/**
	 * 支付
	 * 
	 * @param id
	 */
	public void pay(Long id);

	/**
	 * 取消订单
	 * 
	 * @param id
	 */
	public void delete(Long id);
	
	/**
	 * 
	 * @param agent
	 * @param shopping
	 * @param locationDetail
	 * @return
	 */
	public Order create(Agent agent, Shopping shopping, LocationDetailResponse locationDetail);
	
	/**
	 * 
	 * @param order
	 * @return
	 */
	public Order staying(Order order);
	
	/**
	 * 
	 * @param orderId
	 */
	public void paying(Long orderId);
	
	/**
	 * 
	 * @param order
	 * @param openid
	 * @param remoteIp
	 * @param couponId
	 * @param type
	 * @param callbackUrl
	 * @return
	 */
	public Map<String, Object> prepay(Order order, String openid, String remoteIp,Long couponId, String type, String callbackUrl);

	
	/**
	 * 
	 * @param order
	 * @param openid
	 * @return
	 */
	public Map<String, Object> handpay(Order order, String openid);

	/**
	 * @param agent
	 * @param status
	 * @return
	 */
	public List<Order> list(Agent agent, OrderStatus status);
	
	/**
	 * 
	 * @param order
	 * @return
	 */
	public List<OrderSpecialEquipment> listSpecialEquipment(Order order);
	
	/**
	 * 
	 * @param order
	 * @return
	 */
	public List<OrderVehicleFee> listVehicleFee(Order order);

	/**
	 * 取消预定
	 * @param orderId
	 */
	public void cancelBooking(Long orderId);

	/**
	 * 取消订单
	 * @param orderId
	 * @return
	 */
	public void cancelOrder(Long orderId);
	
	/**
	 * 
	 * @param order
	 * @return
	 */
	public Map<String, Object> generateReservation(Order order);
	
	/**
	 * 
	 * @param order
	 * @return
	 */
	public Map<String, Object> generateCancel(Order order);

	/**
	 * @param orderId
	 */
	public void arrivePay(Long orderId);

	/**
	 *
	 * @param orderId
	 */
	public void otherPay(Long orderId);

	/**
	 *
	 * @param secondaryAgentId
	 * @return
	 */
    List<Order> listByAgentId(Long secondaryAgentId);
}
